package it.poli.IA.strategies;

import it.poli.IA.exceptions.EmptyQueueException;
import it.poli.IA.exceptions.FailureException;
import it.poli.IA.space.Action;
import it.poli.IA.space.Node;
import it.poli.IA.space.NodeActionMemory;
import it.poli.IA.space.State;

import java.util.Collection;
import java.util.Deque;
import java.util.List;

public class BackTrackingStrategy implements SearchStrategy {

	@Override
	public Collection<? extends Action> SomeSearch(Node n0,
			List<? extends Action> action, List<? extends State> Goals,
			Strategies strategy) throws FailureException
	{
		NodeActionMemory node0;
		if(n0 instanceof NodeActionMemory == false)
			return null;
		else 
		{
			node0 = (NodeActionMemory)n0;
		}
		
		while(node0.stillActionToTry())
		{
			try {
				NodeActionMemory candidate = node0.removeFirstChild();
			} catch (EmptyQueueException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}
		
		
		
		
		return null;
	}

	@Override
	public Deque<Action> BuildSolution(Node n) {
		// TODO Auto-generated method stub
		return null;
	}

}
